if (list) {
list->start = start;
list->len = cp-start;
+ list->plen = list->len;
+ list->prefix = 0;
if (*start)
list->hash = hash(start, list->len, 0);
else
continue;
if (e.start[0] == 0)
continue;
- c = (unsigned char *)e.start;
+ c = (unsigned char *)e.start - e.prefix;
highlight_space = 0;
attr = visible(mode, m, &pos);
if ((attr == a_unmatched || attr == a_extra) &&
changed &&
(*c == ' ' || *c == '\t'))
highlight_space = 1;
- for (l = 0; l < e.len; l++) {
+ for (l = 0; l < e.plen + e.prefix; l++) {
int scol = col;
(void)attrset(attr);
if (*c >= ' ' && *c != 0x7f) {
void printword(FILE *f, struct elmnt e)
{
if (e.start[0])
- fprintf(f, "%.*s", e.len, e.start);
+ fprintf(f, "%.*s", e.plen + e.prefix,
+ e.start - e.prefix);
else {
int a, b, c;
sscanf(e.start+1, "%d %d %d", &a, &b, &c);
struct elmnt {
char *start;
int hash;
- int len;
+ short len, plen, prefix;
};
static inline int match(struct elmnt *a, struct elmnt *b)
{
if (e.len == 20 && e.start[0] == 0)
return 1;
- return e.len && e.start[e.len-1] == '\n';
+ return e.len && e.start[e.plen-1] == '\n';
}
struct csl {